<?php
$root = dirname(__FILE__).'/..';
@unlink($root.'/'.'assemmbly.php');
require("$root/libs/util/generateassembly.php");

$includePaths = array(
    $root.'/controllers',
    $root.'/interceptors',
    $root.'/libs',
    $root.'/services',
    $root.'/client',
);
$excludePaths = array();

$generator = new GenerateAssembly($root.'/assembly.php', $includePaths, $excludePaths);
$generator->generate();
//$includedirs = " $root/controllers/ $root/interceptors/ $root/libs/ $root/services/";
//exec("grep  -rP  '^class \w+\b' $includedirs ", $outputs);
//$autoloadfunctionstr='
//<?php
//function __autoload($classname)
//{
//    $classpath = array(
//';
//foreach($outputs as $output)
//{
//    $path_class = explode(':class ', $output);
//    $path = $path_class[0];
//    $class = $path_class[1];
//$autoloadfunctionstr .= "    '{$class}' => '{$path}',\n";
//}
//$autoloadfunctionstr .='
//    );
//    if(isset($classpath[$classname]))
//    {
//        include_once($classpath[$classname]);
//    }
//
//}
//';
//file_put_contents($root.'/assembly.php', $autoloadfunctionstr);

?>
